<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>MD5 Test</title>
  <script src="./md5.js"></script>
  <script src="./md5.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
  </head>
  <script>
    function getData() {
      var oInput = $('#input')
      var oInputValue  = oInput.val()
      if(oInputValue == ''){
        return 
      }else {
        var outputValue = md5(oInputValue)
        $('#output')[0].innerHTML = outputValue
      }
    }

    function reset() {
      $('#input').val(null)
      $('#output')[0].innerHTML = null
      // console.log($('#input')[0].val());
    }
  </script>

  <style>
    html, body{
      width: 90%;
      margin: 0 auto;
      background-color: #000;
      color: white;
      font-family: JetBrains Mono;
    }
    #input{
      display: block;
      width: 100%;
      height: 150px;
      margin-bottom: 40px;
      border-radius: 6px;
      border: 2px solid purple;
      font-size: 20px;
      color: white;
      background-color:gray;
    }
    .button {
      height:30px;
      /* padding: 10px ; */
      border-radius: 8px;
      margin-right: 10px;
      outline: none;
    }

    .calculate{
      background-color: cyan;
    }
    .reset{
      background-color:gainsboro;
    }

    #output {
      margin-top: 30px;
      height: 50px;
      border: 2px solid palegoldenrod;
      border-radius: 6px;
      background-color: gray;
      color: white;
      font-size: 18px;
      line-height: 50px;
    }
  </style>
</head>
<body>
<div class="container">
  <h1>JavaScript MD5 Demo</h1>
  <div class="input">
    <h3>input</h3>
    <textarea id="input"></textarea>
    <button class="button calculate"onclick="getData()">Calculate</button>
    <button class="button reset" onclick="reset()">Reset</button>
  </div>
  <div id="output"></div>
</div>  
</body>
</html>